def upper_attr(class_name,class_parent,class_attr):
    #遍历属性字典，把不是__开头的属性名称都编程大写
    newAttr={}
    for name,value in class_attr.items():
        if not name.startswith("__"):
            newAttr[name.upper()]=value
    #调用type来创建类
    return type(class_name,class_parent,newAttr)
class A(object,metaclass=upper_attr):
    mark="帅哥"

print(hasattr(A,"mark"))
print(hasattr(A,"MARK"))

print(A.MARK)


